<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import = "com.db4o.ext.ExtObjectContainer" %>
<%@page import = "com.db4o.servlet.Db4oServlet" %>
<%@page import = "facades.*" %>
<%@page import = "auser.*" %>
<%@page import = "java.util.*" %>
<%  Db4oCareTaker db4oct = new Db4oCareTaker(session,"padova"); %>
<% 
	
	com.db4o.ObjectContainer co = db4oct.getContainer();
	ParametersPDoppia p=null;
	com.db4o.query.Query q = db4oct.newQuery(ParametersPDoppia.class)  ;
	
	try{
		p =  (ParametersPDoppia)q.execute().next();
	}catch(Exception e){ 
		
	}
	if(p==null){
		p = new ParametersPDoppia("pdoppia"); 
	}
	
	p.setPercQuotaTesseraCircolo(70.0);
	p.setPercQuotaTesseraNaz(5.0);
	p.setPercQuotaTesseraReg(10.0);
	p.setPercQuotaTesseraProv(15.0);
	 
	p.setRipQuotaTesseraNaz(2.50);
	p.setRipQuotaTesseraProv(1.50);
	p.setRipQuotaTesseraReg(2.00);
	p.setRipQuotaTesseraProvFa(1.00); 
	
	p.setCodiceQuotaTesseraCircolo("80.AU.01.0");
	p.setCodiceQuotaTesseraNaz("29.AU.02.0");
	p.setCodiceQuotaTesseraReg("29.AU.03.0");
	p.setCodiceQuotaTesseraProv("29.AU.04.0");
	p.setCodiceQuotaTesseraProvFA("29.FA.04.0");
	p.setCodiceQuotaAuser("81.AU.01.0");
	p.setCodiceQuotaFA("81.FA.01.0");
	p.setCodiceQuotaUpel("81.UP.01.0");
	p.setCodiceCassa("01.AU.01.0");
	
	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceCassa());
	p.setPcCassa((PianoDeiConti)q.execute().next());
	p.getPcCassa().setId(db4oct.getID(p.getPcCassa()));

	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaTesseraCircolo());
	p.setPcQuotaTesseraCircolo((PianoDeiConti)q.execute().next());
	p.getPcQuotaTesseraCircolo().setId(db4oct.getID(p.getPcQuotaTesseraCircolo()));

	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaTesseraNaz());
	p.setPcQuotaTesseraNaz((PianoDeiConti)q.execute().next());
	p.getPcQuotaTesseraNaz().setId(db4oct.getID(p.getPcQuotaTesseraNaz()));

	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaTesseraProv());
	p.setPcQuotaTesseraProv((PianoDeiConti)q.execute().next());
	p.getPcQuotaTesseraProv().setId(db4oct.getID(p.getPcQuotaTesseraProv()));

	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaTesseraProvFA());
	p.setPcQuotaTesseraProvFA((PianoDeiConti)q.execute().next());
	p.getPcQuotaTesseraProvFA().setId(db4oct.getID(p.getPcQuotaTesseraProvFA()));

	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaTesseraReg());
	p.setPcQuotaTesseraReg((PianoDeiConti)q.execute().next());
	p.getPcQuotaTesseraReg().setId(db4oct.getID(p.getPcQuotaTesseraReg()));

	
	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaAuser());
	p.setPcQuotaAuser((PianoDeiConti)q.execute().next());
	p.getPcQuotaAuser().setId(db4oct.getID(p.getPcQuotaAuser()));

	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaFA());
	p.setPcQuotaFA((PianoDeiConti)q.execute().next());
	p.getPcQuotaFA().setId(db4oct.getID(p.getPcQuotaFA()));
	
	q = db4oct.newQuery(PianoDeiConti.class);
	q.descend("codice").constrain(p.getCodiceQuotaUpel());
	p.setPcQuotaUpel((PianoDeiConti)q.execute().next());
	p.getPcQuotaUpel().setId(db4oct.getID(p.getPcQuotaUpel()));
	
	co.set(p);
	co.commit();	 
%>
<%=new Date() %><br>
